<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>表单添加编辑渲染</title>
<{$showjs}>
<link rel="stylesheet" type="text/css" href="../css/main.css" />
<{section name=li loop=$plugcss}>
<link rel="stylesheet" type="text/css" href="<{$plugcss[li]}>" />
<{/section}>
<{section name=li loop=$plugurl}>
<script type="text/javascript" src="<{$plugurl[li]}>"></script>
<{/section}>

<style type="text/css">
.x-date-menu > ul{
display: inline;
}
.x-date-menu > ul li{
display: inline;
}
.hang {
	background: #D1DDEF;
	border-top:1px dotted #B5B8C8;
	border-bottom:1px dotted #B5B8C8;
}

</style>
<script language="javascript">
Ext.onReady(function(){

    Ext.QuickTips.init();
    
    // turn on validation errors beside the field globally
    Ext.form.Field.prototype.msgTarget = 'side';

    var form = new Ext.FormPanel({
        frame: true,
        renderTo:'form-ct',
        bodyStyle: 'padding:0 10px 0;',
        
        items: [            {
						xtype:'hidden',
			            name: 'id',
						id:'id',
			            value:'<{$id}>'
		    },{
						xtype:'hidden',
			            name: 'tid',
			            value:'<{$tid}>'
		    },{
						xtype:'hidden',
			            name: 'bdtid',
			            value:'<{$bdtid}>'
		    },{
						xtype:'hidden',
			            name: 'bdid',
			            value:'<{$bdid}>'
		    },{
						xtype:'hidden',
			            name: 'gid',
			            value:'<{$gid}>'
		    },{
						xtype:'hidden',
			            name: 'lg',
			            value:'<{$lg}>'
		    },{
						xtype:'hidden',
			            name: 'zd',
			            value:'<{$smarty.get.fname}>'
		    },
<{$fcf}>],
        
		buttons: [{
			xtype:'button',
            text: '保存',
            handler:function (){
								if(form.form.isValid()){
								<{$fckplugin}>
								form.form.doAction('submit',{
									url:'i.php',
									method:'POST',
									params:{op:'save'},
									waitMsg:'正在提交....',
									success:function(form,action){
											if (action.result.msg=='ok') {
											top.Ext.get('fname<{$smarty.get.tid}><{$smarty.get.fname}><{$smarty.get.id}>').destroy() ;
												
											} else {
												Ext.Msg.alert('提示',unescape(action.result.msg));
											}
									 }
									 ,
									 //提交失败的回调函数
									 failure:function(){
											Ext.Msg.alert('错误','数据提交错误！');
									 }
								})};
							}
        },{
        	xtype:'button',
            text: '取消',
			handler:function (){	form.form.reset();
			}
        }]
    });
	<{section name=li loop=$plugjs}>
<{$plugjs[li]}>
<{/section}>

});
</script>
</head>
<body>
    <div id="form-ct"></div>

</body>
</html>